<!--
//根据id获取元素(节点)
function $(id){
	if(id instanceof String||typeof id=="string"){
		return document.getElementById(id);
	} else {
		return null;
	}
}
//根据name获取表单项
function $name(name){
	if(name instanceof String||typeof name=="string"){
		var elems = document.getElementsByName(name);
		var elemsArray = new Array();
		for(var i=0;i<elems.length;i+=1){
			if(elems[i].name!==undefined||elems[i].name!=name){
				elemsArray[elemsArray.length] = elems[i];
			}
		}
		if(elemsArray.length<1){
			return null
		} else {
			return elemsArray;
		}
	} else {
		return null;
	}
}
function Map(){
	var keys = new Array();
	var values = new Array();
	this.clear = function(){
		keys = new Array();
		values = new Array();
	}
	this.get = function(key){
		for(var i=0;i<keys.length;i+=1){
			if(key===keys[i]){
				return values[i];
			}
		}
		return null;
	}
	this.isEmpty = function(){
		return (keys.length<1);
	}
	this.put = function(key, value){
		if(key==null){
			return null;
		}
		var index = null;
		for(var i=0;i<keys.length;i+=1){
			if(key===keys[i]){
				index = i;
				break;
			}
		}
		if(index!=null){
			var oldValue = null;
			oldValue = values[index];
			values[index] = value;
			return oldValue;
		} else {
			keys[keys.length] = key;
			values[values.length] = value;
			return null;
		}
	}
	this.remove = function(){
		for(var i=0;i<keys.length;i+=1){
			if(key===keys[i]){
				var value = values[i];
				keys.splice(i,1);
				values.splice(i,1);
				return value;
			}
		}
		return null;
	}
	this.size = function(){
		return keys.length;
	}
	this.toString = function(){
		var str = "";
		if(keys.length>0){
			str += keys[0] + " - " + values[0];
			for(var i=1;i<keys.length;i+=1){
				str += "\n" + keys[i] + " - " + values[i];
			}
		} else {
			str = "The Map is Empty.";
		}
		return str;
	}
	return this;
}
//-->